/*
 * @Author: yangzonglong
 * @Date: 2021-03-03 14:44:59
 * @version: v1.0.0
 * @Descripttion: Input 控制器
 * @LastEditors: yangzonglong
 * @LastEditTime: 2023-03-22 20:35:01
 * @Auditor:
 */
import React from 'react';
import useControlOptions from '../../hooks/useControlOptions';
import FormItemController from './../components/FormItemController';

const Controller = () => {

  const { options, changeFormItemProps, changeControlProps } = useControlOptions<any>('scanProps');

  return (
    <>
      <FormItemController
        onChange={changeFormItemProps}
        placeholder={options?.scanProps?.placeholder}
        placeholderEn={options?.scanProps?.placeholderEn}
        onChangePlaceholder={(e) =>
          changeControlProps(
            'scanProps',
            {
              ...options?.scanProps,
              placeholder: e,
            },
            true
          )}
        onChangePlaceholderEn={(e) =>
          changeControlProps(
            'scanProps',
            {
              ...options?.scanProps,
              placeholderEn: e,
            },
            true
          )
        }
        options={options?.formItemProps}>

      </FormItemController>


    </>
  );
};

export default Controller;
